package com.neu.niuyuchao.servlet;

import com.neu.niuyuchao.service.MgrInfoService;
import com.neu.niuyuchao.service.StuInfoService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

@WebServlet(name = "StuInfoServlet", urlPatterns = {"/StuInfoServlet.do"})
public class StuInfoServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
     request.setCharacterEncoding("utf-8");
        String stu_no=request.getParameter("stu_no");
        Map<String,Object> item=null;
        StuInfoService stu=new StuInfoService();
        item=stu.doFind(stu_no);
        HttpSession session=request.getSession();
        session.setAttribute("items",item);
        request.getRequestDispatcher("WEB-INF/Stu/stu_info.jsp").forward(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }
}
